import django
from django.conf import settings

from article.models import Category,Article
# settings.configure()
django.setup()
if __name__ == '__main__':
    for x in range(10):
        c = Category(
            name='文章分类_%s'% str(x),
            slug='slug_%s' % str(x)
        )
        c.save()
        for y in range(100):
            a = Article(
                name='文章——%s 来自分类%s' % (str(y), str(x)),
                content='文章内容文章——%s 来自分类%s' % (str(y), str(x))
                ,category=c
            )
            a.save()